# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pdfkit
pkgname=('python2-pdfkit' 'python-pdfkit')
_pkgname=pdfkit
pkgver=1.0.0
pkgrel=6
pkgdesc='Wkhtmltopdf python wrapper to convert html to pdf using the webkit rendering engine and qt.'
arch=('any')
url='https://pypi.python.org/pypi/pdfkit/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f00d66ff0f425b2313d06e052aa83e2cf526074307ab10c8ea370dab5503d6642228ca92795754c73c45640f09f7252ec7a6b66cdccd9f5f1d34fa5e686b1c6f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pdfkit() {
  depends=('python2' 'wkhtmltopdf')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pdfkit() {
  depends=('python' 'wkhtmltopdf')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

